#pragma warning disable 0618
using System;
using System.Collections.Generic;
using Table.DataModel;
namespace Table.Dao
{
    public class TableActivityRaidDao:DaoBase<TableActivityRaid>
    {
        public override string GetFileName()
        {
            return "TableActivityRaid.csv";
        }
        public override void BuildIndex()
        {
            if (cacheList != null)
            {
                cachePrimaryInt = new Dictionary<int, TableActivityRaid>(cacheList.Count);
            }
            base.BuildIndex();
        }
        public override void AddPrimaryIndex(TableActivityRaid model)
        {
            #if UNITY_EDITOR
            if(cachePrimaryInt.ContainsKey(model.raidId)) UnityEngine.Debug.LogError("数据表id重复:TableActivityRaid->id: " + model.raidId);
            #endif
            cachePrimaryInt[model.raidId] = model;
        }
        protected override TableActivityRaid ParseRowData(string[] rowData)
        {
            TableActivityRaid data = new TableActivityRaid();
            if (!string.IsNullOrEmpty(rowData[0]))
            {
                data.raidId = int.Parse(rowData[0]);
            }
            if (!string.IsNullOrEmpty(rowData[1]))
            {
                data.raidType = int.Parse(rowData[1]);
            }
            if (!string.IsNullOrEmpty(rowData[2]))
            {
                data.bgName = string.Intern(rowData[2]);
            }
            if (!string.IsNullOrEmpty(rowData[3]))
            {
                data.buffName = rowData[3];
            }
            if (!string.IsNullOrEmpty(rowData[4]))
            {
                data.raidName = string.Intern(rowData[4]);
            }
            if (!string.IsNullOrEmpty(rowData[5]))
            {
                data.openTime = string.Intern(rowData[5]);
            }
            if (!string.IsNullOrEmpty(rowData[6]))
            {
                data.costItems = rowData[6];
            }
            if (!string.IsNullOrEmpty(rowData[7]))
            {
                data.titleImage = rowData[7];
            }
            return data;
        }
    }
}
